#include <pthread.h>
#include <stdio.h>
static int global = 1;
void *t1_execute(void *arg)
{
    while (global < 100)
    {
        printf("The value is %4d\n", global);
    }
}
void *t2_execute(void *arg)
{
    while (1)
    {
        global++;
        sleep(1);
    }
}
void main()
{
    pthread_t pid1, pid2;
    int error1, error2;
    error1 = pthread_create(&pid1, NULL, t1_execute, NULL);
    error2 = pthread_create(&pid2, NULL, t2_execute, NULL);
    pthread_join(pid1, NULL);
    pthread_join(pid2, NULL);
}